package com.virgil.core.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * @author Virgil
 * @Date 2020年8月17日
 * @Describe
 *           <p>
 *            注入切面 使LogAspect生效
 *           </p>
 */
@Configuration
@EnableConfigurationProperties(LogProperties.class)
@ConditionalOnBean(LogMarkerConfiguration.Marker.class)
@Slf4j
public class LogAutoConfiguration {
	
	@Bean
	public RequestLogAspect requestLogAspect(@Autowired LogProperties logProperties) {
		log.info("开启日志AOP......");
		return new RequestLogAspect(logProperties);
	}
	
}
